% Basic Introduction:
% This function computes the one-step Newton update given the der_1 (or 
% the f0) and the der_2 (or the der_1). The function also incorporates the
% reflection revision given the left and right interval bound.
% Special Note:
% If we do not want to use the reflection revision, we can simply use Left
% as -Inf and Right as Inf.
% Function Form:
% [X1]=VecNewton_OneStepUpdate(X0,[der_1,der_2],Left,Right)

function [X1]=VecNewton_OneStepUpdate(X0,der,Left,Right)

% Gaussian Update
X1      =   X0-der(:,1)./der(:,2);
% Reflection Revision
I_left  =   X1<Left;
X1(I_left)      =   (X0(I_left)+Left(I_left))/2;
I_right =   X1>Right;
X1(I_right)     =   (X0(I_right)+Right(I_right))/2;
